﻿
@{
    Layout = null;
    
    
   var  AuthId=ViewBag.AuthId;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>
    <style>
        *{margin:0;padding:0}
        p{
            margin-top:20px;
            text-align:center;
            font-size:24px;
            color:#444;
        }
        div{
            margin:10px 0;
            text-indent:2em;
            font-size:16px;
            color:#666;
        }
        img{
            width:100%;
        }
    </style>
</head>
<body style="background:#FFF;width:90%;padding:0 5%" id="AuthPreview">
</body>
</html>

@*<script src="~/Scripts/jquery.js"></script>*@
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<input type="hidden"  id="AuthId" value="@AuthId"/>

<script>


    $(document).ready(function () {

        var authId = $("#AuthId").val();

        GetAuthModuleListByAuthId(authId);
    });

    function GetAuthModuleListByAuthId(authId) {

        $.ajax({
            type: "POST",
            dataType: 'json',
            url: "/MaterialPreview/" + "GetAuthModuleListByAuthId?Id=" + authId,
            cache: false,
            success: function (data) {
                var html="";
                for (var i = 0; i < data.length; i++) {
                    html += "<p>" + data[i].ModuleName + "</p><div>" + data[i].Content + "</div><img src='" + data[i].Picture + "' />"
                }
                $("#AuthPreview").append(html)
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert(jqXHR.responseText);
            }

        });


    }

</script>